package com.example.basicdemo.model.builder;

import com.isyscore.os.dev.api.IsyscoreRequestBuilder;
import com.isyscore.os.dev.util.IsyscoreHashMap;
import com.isyscore.os.dev.util.RequestUtils;

import javax.servlet.http.HttpServletRequest;

public class UpdateUserPasswordRequestBuilder extends IsyscoreRequestBuilder {
    private IsyscoreHashMap headers;

    /**
     * 密码，5~18个字符
     */
    private String password;

    /**
     * 旧密码，5~18个字符
     */
    private String oldPassword;

    /**
     * 是否清除token，默认不清除
     */
    private Boolean clearToken;

    public String getPassword() {
        return password;
    }

    public UpdateUserPasswordRequestBuilder setPassword(String password) {
        this.password = password;
        return this;
    }

    public IsyscoreHashMap getHeaders() {
        return headers;
    }

    public UpdateUserPasswordRequestBuilder setHeaders(IsyscoreHashMap headers) {
        this.headers = headers;
        return this;
    }

    @Override
    public boolean validate() {
        return true;
    }

    @Override
    public IsyscoreRequestBuilder setRequestHeader(HttpServletRequest request) {
        this.headers = RequestUtils.getRequestHeader(request);
        return this;
    }
}
